package com.mojo.demo2;

import com.mojo.demo1.Landlord;
import com.mojo.demo1.Rent;

/**
 * 客户端调用
 *
 * @author <a href="mailto:mojo_jj@163.com">Mojo</a>
 * copyright (C), 2013-2021, 广州九尾信息科技有限公司
 */
public class Client {
    public static void main(String[] args) {
        //真实角色
        Rent landlord = new Landlord();
        ProxyInvocationHandler invocationHandler = new ProxyInvocationHandler();
        invocationHandler.setT(landlord);
        //获取代理角色，基于jdk的动态代理必须用接口来接受
        Rent proxy = (Rent) invocationHandler.getProxy();
        proxy.rent();

    }
}
